import java.sql.*;

public class Libreria {

	public static void main(String[] args) {

		try {
			Class.forName("com.mysql.jdbc.Driver");
			Connection conexion = DriverManager.getConnection(
					"jdbc:mysql://localhost/libreria", "root", "root");
			Statement s = conexion.createStatement();
		
			s.executeUpdate("delete from libros");
			s.executeUpdate("insert into libros values ('9','titulo1','2000-08-03','10')");
			s.executeUpdate("insert into libros values ('8','titulo2','2005-02-02','11')");
			s.executeUpdate("insert into libros values ('7','titulo3','1998-11-9','12')");
			conexion.close();
		} catch (Exception e) {
			e.printStackTrace();
		}

		try {
			Class.forName("com.mysql.jdbc.Driver");
			Connection conexion = DriverManager.getConnection(
					"jdbc:mysql://localhost/libreria", "root", "root");
			Statement s = conexion.createStatement();
			s.executeUpdate("delete from autor");
			s.executeUpdate("insert into autor values ('13','autor1','1954-05-07')");
			s.executeUpdate("insert into autor values ('11','autor2','1980-06-06')");
			s.executeUpdate("insert into autor values ('12','autor3','1948-09-06')");
			conexion.close();
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

}
